import { defHttp } from "@/utils/http";
// ERP 借款类型 VO
export interface LoanTypeVO {
	id: number; // 主键,示例值(19773)
	name: string; // 名称,示例值(王五)
	parentId: number; // 父级ID,示例值(21769)
	sqNumb: number; // 序号
	cityFlag: number; // 城市标识
}

// ERP 借款类型 API
export const LoanTypeApi = {
	// 查询借款类型分页
	getLoanTypePage: async (params: any) => {
		return await defHttp.get({ url: `/whs/loan-type/page`, params });
	},

	// 查询借款类型详情
	getLoanType: async (id: number) => {
		return await defHttp.get({ url: `/whs/loan-type/get?id=` + id });
	},

	// 新增借款类型
	createLoanType: async (data: LoanTypeVO) => {
		return await defHttp.post({ url: `/whs/loan-type/create`, data });
	},

	// 修改借款类型
	updateLoanType: async (data: LoanTypeVO) => {
		return await defHttp.put({ url: `/whs/loan-type/update`, data });
	},

	// 删除借款类型
	deleteLoanType: async (id: number) => {
		return await defHttp.delete({ url: `/whs/loan-type/delete?id=` + id });
	},

	// 导出借款类型 Excel
	exportLoanType: async (params: any) => {
		return await defHttp.download({ url: `/whs/loan-type/export-excel`, params });
	}
};
